/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vista;

import controlador.ABControlador;
import controlador.EstadosSwitchControlador;
import controlador.ReportesControlador;
import java.awt.Image;
import java.awt.Toolkit;
import java.text.DecimalFormat;
import javax.swing.JFormattedTextField;
import javax.swing.text.NumberFormatter;

/**
 *
 * @author Rodrigo Martínez
 */
public class PrincipalVista extends javax.swing.JFrame {

    /**
     * Creates new form PrincipalVista
     */
    private ABControlador principalControlador;
    private ReportesControlador reportesControlador;
    private EstadosSwitchControlador estadosSwitch;
    private boolean agregar = true;
    
    public PrincipalVista() {
        initComponents();
        this.setLocationRelativeTo(null);
        iniciarControladores();
        personalizarCampos();
    }
    
    private void iniciarControladores(){
        principalControlador = new ABControlador(this);
        reportesControlador = new ReportesControlador(this);
        estadosSwitch = new EstadosSwitchControlador(this);
    }
    
    private void personalizarCampos(){
        JFormattedTextField efNum = new JFormattedTextField(new DecimalFormat("0"));
        NumberFormatter nf = (NumberFormatter) efNum.getFormatter();
        vlanTextField.setFormatterFactory(efNum.getFormatterFactory());
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        abcIU = new javax.swing.JDialog();
        jScrollPane1 = new javax.swing.JScrollPane();
        principalTable = new javax.swing.JTable();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        agregarIU = new javax.swing.JDialog();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        nombreEquipoTextField = new javax.swing.JTextField();
        usuarioTextField = new javax.swing.JTextField();
        direccionIPTextField = new javax.swing.JTextField();
        direccionMACTextField = new javax.swing.JTextField();
        puertoTextField = new javax.swing.JTextField();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        vlanTextField = new javax.swing.JFormattedTextField();
        reportesIU = new javax.swing.JDialog();
        jLabel7 = new javax.swing.JLabel();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        usuMACIPIUReporte = new javax.swing.JDialog();
        jScrollPane3 = new javax.swing.JScrollPane();
        usuIPMACTable = new javax.swing.JTable();
        jButton14 = new javax.swing.JButton();
        generalReporte = new javax.swing.JDialog();
        jScrollPane2 = new javax.swing.JScrollPane();
        generalTable = new javax.swing.JTable();
        jButton13 = new javax.swing.JButton();
        vlansReporte = new javax.swing.JDialog();
        jScrollPane4 = new javax.swing.JScrollPane();
        vlansTable = new javax.swing.JTable();
        jButton15 = new javax.swing.JButton();
        estadoSwitchUI = new javax.swing.JDialog();
        jLabel8 = new javax.swing.JLabel();
        ipTextField = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        comuTextField = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        puerto2TextField = new javax.swing.JTextField();
        jButton17 = new javax.swing.JButton();
        modeloTextField = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jBPuerto1 = new javax.swing.JButton();
        jBPuerto2 = new javax.swing.JButton();
        jBPuerto3 = new javax.swing.JButton();
        jBPuerto4 = new javax.swing.JButton();
        jBPuerto5 = new javax.swing.JButton();
        jBPuerto6 = new javax.swing.JButton();
        jBPuerto7 = new javax.swing.JButton();
        jBPuerto8 = new javax.swing.JButton();
        jBPuerto9 = new javax.swing.JButton();
        jBPuerto10 = new javax.swing.JButton();
        jBPuerto11 = new javax.swing.JButton();
        jBPuerto12 = new javax.swing.JButton();
        jBPuerto13 = new javax.swing.JButton();
        jBPuerto14 = new javax.swing.JButton();
        jBPuerto15 = new javax.swing.JButton();
        jBPuerto16 = new javax.swing.JButton();
        jBPuerto17 = new javax.swing.JButton();
        jBPuerto18 = new javax.swing.JButton();
        jBPuerto19 = new javax.swing.JButton();
        jBPuerto20 = new javax.swing.JButton();
        jBPuerto21 = new javax.swing.JButton();
        jBPuerto22 = new javax.swing.JButton();
        jBPuerto23 = new javax.swing.JButton();
        jBPuerto24 = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        reporteButton = new javax.swing.JButton();
        reportesButton = new javax.swing.JButton();
        estadoSwitchButton = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();

        abcIU.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        abcIU.setMinimumSize(new java.awt.Dimension(770, 240));
        abcIU.setModal(true);
        abcIU.setResizable(false);

        principalTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null}
            },
            new String [] {
                "Fecha Alta", "Fecha Modificacion", "Nombre Equipo", "Usuario", "Direccion IP", "Direccion MAC", "VLAN", "lPuerto"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(principalTable);
        principalTable.getColumnModel().getColumn(0).setPreferredWidth(110);
        principalTable.getColumnModel().getColumn(1).setPreferredWidth(110);
        principalTable.getColumnModel().getColumn(4).setPreferredWidth(90);
        principalTable.getColumnModel().getColumn(5).setPreferredWidth(90);
        principalTable.getColumnModel().getColumn(6).setPreferredWidth(30);
        principalTable.getColumnModel().getColumn(7).setPreferredWidth(40);

        jButton2.setText("Agregar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Eliminar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Modificar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setText("Salir");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout abcIULayout = new javax.swing.GroupLayout(abcIU.getContentPane());
        abcIU.getContentPane().setLayout(abcIULayout);
        abcIULayout.setHorizontalGroup(
            abcIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(abcIULayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(abcIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(abcIULayout.createSequentialGroup()
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(26, 26, 26)
                        .addComponent(jButton4)
                        .addGap(18, 18, 18)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 750, Short.MAX_VALUE))
                .addContainerGap())
        );
        abcIULayout.setVerticalGroup(
            abcIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, abcIULayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(abcIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton4)
                    .addComponent(jButton3)
                    .addComponent(jButton5))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(58, 58, 58))
        );

        agregarIU.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        agregarIU.setMinimumSize(new java.awt.Dimension(275, 310));
        agregarIU.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
        agregarIU.setResizable(false);

        jLabel1.setText("Nombre de Equipo:");

        jLabel2.setText("Usuario:");

        jLabel3.setText("Direccion IP:");

        jLabel4.setText("Direccion MAC:");

        jLabel5.setText("VLAN:");

        jLabel6.setText("Puerto:");

        jButton6.setText("Guardar");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton7.setText("Cancelar");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        vlanTextField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#,##0"))));

        javax.swing.GroupLayout agregarIULayout = new javax.swing.GroupLayout(agregarIU.getContentPane());
        agregarIU.getContentPane().setLayout(agregarIULayout);
        agregarIULayout.setHorizontalGroup(
            agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(agregarIULayout.createSequentialGroup()
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(agregarIULayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(nombreEquipoTextField)
                            .addComponent(usuarioTextField)
                            .addComponent(direccionIPTextField)
                            .addComponent(direccionMACTextField)
                            .addComponent(puertoTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
                            .addComponent(vlanTextField)))
                    .addGroup(agregarIULayout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addComponent(jButton6)
                        .addGap(34, 34, 34)
                        .addComponent(jButton7)))
                .addContainerGap(26, Short.MAX_VALUE))
        );
        agregarIULayout.setVerticalGroup(
            agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(agregarIULayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(nombreEquipoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(usuarioTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(direccionIPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(direccionMACTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(vlanTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(puertoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(agregarIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton6)
                    .addComponent(jButton7))
                .addContainerGap(83, Short.MAX_VALUE))
        );

        reportesIU.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        reportesIU.setMinimumSize(new java.awt.Dimension(275, 240));
        reportesIU.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
        reportesIU.setResizable(false);

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel7.setText("Lista de Reportes");

        jButton9.setText("usuarios y sus direcciones MAC e IP");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton10.setText("VLANS y sus asociados");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        jButton11.setText("General con todos los campos");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jButton12.setText("Salir");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout reportesIULayout = new javax.swing.GroupLayout(reportesIU.getContentPane());
        reportesIU.getContentPane().setLayout(reportesIULayout);
        reportesIULayout.setHorizontalGroup(
            reportesIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(reportesIULayout.createSequentialGroup()
                .addGroup(reportesIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(reportesIULayout.createSequentialGroup()
                        .addGap(80, 80, 80)
                        .addComponent(jLabel7))
                    .addGroup(reportesIULayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(jButton9))
                    .addGroup(reportesIULayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(reportesIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton11)
                            .addComponent(jButton10)
                            .addComponent(jButton12))))
                .addContainerGap(47, Short.MAX_VALUE))
        );
        reportesIULayout.setVerticalGroup(
            reportesIULayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(reportesIULayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addGap(18, 18, 18)
                .addComponent(jButton9)
                .addGap(18, 18, 18)
                .addComponent(jButton11)
                .addGap(18, 18, 18)
                .addComponent(jButton10)
                .addGap(18, 18, 18)
                .addComponent(jButton12)
                .addContainerGap(51, Short.MAX_VALUE))
        );

        usuMACIPIUReporte.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        usuMACIPIUReporte.setMinimumSize(new java.awt.Dimension(395, 287));
        usuMACIPIUReporte.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);

        usuIPMACTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Usuario", "Direccion IP", "Direccion MAC"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(usuIPMACTable);
        usuIPMACTable.getColumnModel().getColumn(2).setResizable(false);

        jButton14.setText("Guardar Reporte");
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout usuMACIPIUReporteLayout = new javax.swing.GroupLayout(usuMACIPIUReporte.getContentPane());
        usuMACIPIUReporte.getContentPane().setLayout(usuMACIPIUReporteLayout);
        usuMACIPIUReporteLayout.setHorizontalGroup(
            usuMACIPIUReporteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(usuMACIPIUReporteLayout.createSequentialGroup()
                .addGroup(usuMACIPIUReporteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(usuMACIPIUReporteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(usuMACIPIUReporteLayout.createSequentialGroup()
                        .addGap(141, 141, 141)
                        .addComponent(jButton14)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        usuMACIPIUReporteLayout.setVerticalGroup(
            usuMACIPIUReporteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, usuMACIPIUReporteLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton14)
                .addGap(75, 75, 75))
        );

        generalReporte.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        generalReporte.setMinimumSize(new java.awt.Dimension(700, 280));
        generalReporte.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
        generalReporte.setResizable(false);

        generalTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null}
            },
            new String [] {
                "Fecha Alta", "Fecha Modificacion", "Nombre Equipo", "Usuario", "DireccionIP", "Direccion MAC", "VLAN", "Puerto"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(generalTable);
        generalTable.getColumnModel().getColumn(0).setPreferredWidth(110);
        generalTable.getColumnModel().getColumn(1).setPreferredWidth(110);
        generalTable.getColumnModel().getColumn(5).setPreferredWidth(90);
        generalTable.getColumnModel().getColumn(6).setPreferredWidth(30);
        generalTable.getColumnModel().getColumn(7).setPreferredWidth(40);

        jButton13.setText("Guardar Reporte");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout generalReporteLayout = new javax.swing.GroupLayout(generalReporte.getContentPane());
        generalReporte.getContentPane().setLayout(generalReporteLayout);
        generalReporteLayout.setHorizontalGroup(
            generalReporteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(generalReporteLayout.createSequentialGroup()
                .addGroup(generalReporteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(generalReporteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 680, Short.MAX_VALUE))
                    .addGroup(generalReporteLayout.createSequentialGroup()
                        .addGap(284, 284, 284)
                        .addComponent(jButton13)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        generalReporteLayout.setVerticalGroup(
            generalReporteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(generalReporteLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton13)
                .addContainerGap(43, Short.MAX_VALUE))
        );

        vlansReporte.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        vlansReporte.setMinimumSize(new java.awt.Dimension(270, 250));
        vlansReporte.setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
        vlansReporte.setResizable(false);
        vlansReporte.getContentPane().setLayout(null);

        vlansTable.setAutoCreateRowSorter(true);
        vlansTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Vlan", "Nombre del Equipo"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane4.setViewportView(vlansTable);
        vlansTable.getColumnModel().getColumn(0).setResizable(false);
        vlansTable.getColumnModel().getColumn(0).setPreferredWidth(40);
        vlansTable.getColumnModel().getColumn(1).setResizable(false);

        vlansReporte.getContentPane().add(jScrollPane4);
        jScrollPane4.setBounds(10, 11, 229, 134);

        jButton15.setText("Guardar Reporte");
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });
        vlansReporte.getContentPane().add(jButton15);
        jButton15.setBounds(60, 170, 120, 23);

        estadoSwitchUI.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        estadoSwitchUI.setTitle("switch");
        estadoSwitchUI.setIconImage(null);
        estadoSwitchUI.setMinimumSize(new java.awt.Dimension(780, 300));
        estadoSwitchUI.setPreferredSize(new java.awt.Dimension(780, 300));
        estadoSwitchUI.setResizable(false);
        estadoSwitchUI.getContentPane().setLayout(null);

        jLabel8.setText("Ip");
        estadoSwitchUI.getContentPane().add(jLabel8);
        jLabel8.setBounds(50, 20, 30, 20);

        ipTextField.setText("192.168.0.1");
        ipTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ipTextFieldActionPerformed(evt);
            }
        });
        estadoSwitchUI.getContentPane().add(ipTextField);
        ipTextField.setBounds(80, 10, 110, 30);

        jLabel9.setText("Comunidad");
        estadoSwitchUI.getContentPane().add(jLabel9);
        jLabel9.setBounds(250, 20, 80, 20);

        comuTextField.setText("fmat");
        comuTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comuTextFieldActionPerformed(evt);
            }
        });
        estadoSwitchUI.getContentPane().add(comuTextField);
        comuTextField.setBounds(330, 10, 90, 30);

        jLabel10.setText("Puerto");
        estadoSwitchUI.getContentPane().add(jLabel10);
        jLabel10.setBounds(450, 20, 60, 20);

        puerto2TextField.setText("161");
        puerto2TextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                puerto2TextFieldActionPerformed(evt);
            }
        });
        estadoSwitchUI.getContentPane().add(puerto2TextField);
        puerto2TextField.setBounds(503, 10, 120, 30);

        jButton17.setText("Conectar");
        jButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton17ActionPerformed(evt);
            }
        });
        estadoSwitchUI.getContentPane().add(jButton17);
        jButton17.setBounds(660, 10, 90, 30);

        modeloTextField.setEditable(false);
        modeloTextField.setText(" ");
        estadoSwitchUI.getContentPane().add(modeloTextField);
        modeloTextField.setBounds(80, 60, 100, 30);

        jLabel12.setText("Modelo");
        estadoSwitchUI.getContentPane().add(jLabel12);
        jLabel12.setBounds(30, 60, 40, 20);

        jBPuerto1.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto1.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto1.setFocusable(false);
        jBPuerto1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto1);
        jBPuerto1.setBounds(120, 150, 40, 30);

        jBPuerto2.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto2.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto2.setFocusable(false);
        jBPuerto2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto2);
        jBPuerto2.setBounds(120, 180, 40, 30);

        jBPuerto3.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto3.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto3.setFocusable(false);
        jBPuerto3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto3);
        jBPuerto3.setBounds(160, 150, 40, 30);

        jBPuerto4.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto4.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto4.setFocusable(false);
        jBPuerto4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto4);
        jBPuerto4.setBounds(160, 180, 40, 30);

        jBPuerto5.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto5.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto5.setFocusable(false);
        jBPuerto5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto5);
        jBPuerto5.setBounds(200, 150, 40, 30);

        jBPuerto6.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto6.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto6.setFocusable(false);
        jBPuerto6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto6);
        jBPuerto6.setBounds(200, 180, 40, 30);

        jBPuerto7.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto7.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto7.setFocusable(false);
        jBPuerto7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto7);
        jBPuerto7.setBounds(240, 150, 40, 30);

        jBPuerto8.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto8.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto8.setFocusable(false);
        jBPuerto8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto8);
        jBPuerto8.setBounds(240, 180, 40, 30);

        jBPuerto9.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto9.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto9.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto9.setFocusable(false);
        jBPuerto9.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto9.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto9);
        jBPuerto9.setBounds(280, 150, 40, 30);

        jBPuerto10.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto10.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto10.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto10.setFocusable(false);
        jBPuerto10.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto10.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto10);
        jBPuerto10.setBounds(280, 180, 40, 30);

        jBPuerto11.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto11.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto11.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto11.setFocusable(false);
        jBPuerto11.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto11.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto11);
        jBPuerto11.setBounds(320, 150, 40, 30);

        jBPuerto12.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto12.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto12.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto12.setFocusable(false);
        jBPuerto12.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto12.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto12);
        jBPuerto12.setBounds(320, 180, 40, 30);

        jBPuerto13.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto13.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto13.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto13.setFocusable(false);
        jBPuerto13.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto13.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto13);
        jBPuerto13.setBounds(390, 150, 40, 30);

        jBPuerto14.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto14.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto14.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto14.setFocusable(false);
        jBPuerto14.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto14.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto14);
        jBPuerto14.setBounds(390, 180, 40, 30);

        jBPuerto15.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto15.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto15.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto15.setFocusable(false);
        jBPuerto15.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto15.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto15);
        jBPuerto15.setBounds(430, 150, 40, 30);

        jBPuerto16.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto16.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto16.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto16.setFocusable(false);
        jBPuerto16.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto16.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto16);
        jBPuerto16.setBounds(430, 180, 40, 30);

        jBPuerto17.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto17.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto17.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto17.setFocusable(false);
        jBPuerto17.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto17.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto17);
        jBPuerto17.setBounds(470, 150, 40, 30);

        jBPuerto18.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto18.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto18.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto18.setFocusable(false);
        jBPuerto18.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto18.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto18);
        jBPuerto18.setBounds(470, 180, 40, 30);

        jBPuerto19.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto19.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto19.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto19.setFocusable(false);
        jBPuerto19.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto19.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto19);
        jBPuerto19.setBounds(510, 150, 40, 30);

        jBPuerto20.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto20.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto20.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto20.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto20.setFocusable(false);
        jBPuerto20.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto20.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto20);
        jBPuerto20.setBounds(510, 180, 40, 30);

        jBPuerto21.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto21.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto21.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto21.setFocusable(false);
        jBPuerto21.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto21.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto21);
        jBPuerto21.setBounds(550, 150, 40, 30);

        jBPuerto22.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto22.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto22.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto22.setFocusable(false);
        jBPuerto22.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto22.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto22);
        jBPuerto22.setBounds(550, 180, 40, 30);

        jBPuerto23.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto23.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/port.png"))); // NOI18N
        jBPuerto23.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto23.setFocusable(false);
        jBPuerto23.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto23.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto23);
        jBPuerto23.setBounds(590, 150, 40, 30);

        jBPuerto24.setBackground(new java.awt.Color(255, 0, 0));
        jBPuerto24.setForeground(new java.awt.Color(255, 0, 0));
        jBPuerto24.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/portdown.png"))); // NOI18N
        jBPuerto24.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBPuerto24.setFocusable(false);
        jBPuerto24.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPuerto24.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        estadoSwitchUI.getContentPane().add(jBPuerto24);
        jBPuerto24.setBounds(590, 180, 40, 30);

        jLabel14.setText("24");
        estadoSwitchUI.getContentPane().add(jLabel14);
        jLabel14.setBounds(600, 210, 20, 14);

        jLabel15.setText("23");
        estadoSwitchUI.getContentPane().add(jLabel15);
        jLabel15.setBounds(600, 130, 20, 14);

        jLabel16.setText("1");
        estadoSwitchUI.getContentPane().add(jLabel16);
        jLabel16.setBounds(130, 130, 20, 14);

        jLabel17.setText("3");
        estadoSwitchUI.getContentPane().add(jLabel17);
        jLabel17.setBounds(170, 130, 20, 14);

        jLabel18.setText("5");
        estadoSwitchUI.getContentPane().add(jLabel18);
        jLabel18.setBounds(210, 130, 20, 14);

        jLabel19.setText("7");
        estadoSwitchUI.getContentPane().add(jLabel19);
        jLabel19.setBounds(250, 130, 20, 14);

        jLabel20.setText("9");
        estadoSwitchUI.getContentPane().add(jLabel20);
        jLabel20.setBounds(290, 130, 20, 14);

        jLabel21.setText("11");
        estadoSwitchUI.getContentPane().add(jLabel21);
        jLabel21.setBounds(330, 130, 20, 14);

        jLabel22.setText("13");
        estadoSwitchUI.getContentPane().add(jLabel22);
        jLabel22.setBounds(400, 130, 20, 14);

        jLabel23.setText("15");
        estadoSwitchUI.getContentPane().add(jLabel23);
        jLabel23.setBounds(440, 130, 20, 14);

        jLabel24.setText("17");
        estadoSwitchUI.getContentPane().add(jLabel24);
        jLabel24.setBounds(480, 130, 20, 14);

        jLabel25.setText("19");
        estadoSwitchUI.getContentPane().add(jLabel25);
        jLabel25.setBounds(520, 130, 20, 14);

        jLabel26.setText("21");
        estadoSwitchUI.getContentPane().add(jLabel26);
        jLabel26.setBounds(560, 130, 20, 14);

        jLabel27.setText("2");
        estadoSwitchUI.getContentPane().add(jLabel27);
        jLabel27.setBounds(130, 210, 20, 14);

        jLabel28.setText("4");
        estadoSwitchUI.getContentPane().add(jLabel28);
        jLabel28.setBounds(170, 210, 20, 14);

        jLabel29.setText("6");
        estadoSwitchUI.getContentPane().add(jLabel29);
        jLabel29.setBounds(210, 210, 20, 14);

        jLabel30.setText("8");
        estadoSwitchUI.getContentPane().add(jLabel30);
        jLabel30.setBounds(250, 210, 20, 14);

        jLabel31.setText("10");
        estadoSwitchUI.getContentPane().add(jLabel31);
        jLabel31.setBounds(290, 210, 20, 14);

        jLabel32.setText("12");
        estadoSwitchUI.getContentPane().add(jLabel32);
        jLabel32.setBounds(330, 210, 20, 14);

        jLabel33.setText("14");
        estadoSwitchUI.getContentPane().add(jLabel33);
        jLabel33.setBounds(400, 210, 20, 14);

        jLabel34.setText("16");
        estadoSwitchUI.getContentPane().add(jLabel34);
        jLabel34.setBounds(440, 210, 20, 14);

        jLabel35.setText("18");
        estadoSwitchUI.getContentPane().add(jLabel35);
        jLabel35.setBounds(480, 210, 20, 14);

        jLabel36.setText("20");
        estadoSwitchUI.getContentPane().add(jLabel36);
        jLabel36.setBounds(520, 210, 20, 14);

        jLabel37.setText("22");
        estadoSwitchUI.getContentPane().add(jLabel37);
        jLabel37.setBounds(560, 210, 20, 14);

        jLabel11.setText("jLabel11");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Proyecto");
        setIconImage(getIconImage());
        setMinimumSize(new java.awt.Dimension(174, 218));

        reporteButton.setText("ABC");
        reporteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reporteButtonActionPerformed(evt);
            }
        });

        reportesButton.setText("Reportes");
        reportesButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reportesButtonActionPerformed(evt);
            }
        });

        estadoSwitchButton.setText("Estado del Switch");
        estadoSwitchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                estadoSwitchButtonActionPerformed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel13.setText("Menu");

        jButton1.setText("Salir");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(reporteButton)
                            .addComponent(reportesButton)
                            .addComponent(estadoSwitchButton)
                            .addComponent(jButton1)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(65, 65, 65)
                        .addComponent(jLabel13)))
                .addContainerGap(28, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel13)
                .addGap(15, 15, 15)
                .addComponent(estadoSwitchButton)
                .addGap(18, 18, 18)
                .addComponent(reportesButton)
                .addGap(18, 18, 18)
                .addComponent(reporteButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void reporteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reporteButtonActionPerformed
        abcIU.setLocationRelativeTo(this);
        principalControlador.actualizarTabla();
        abcIU.setVisible(true);
    }//GEN-LAST:event_reporteButtonActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        agregar = true;
        agregarIU.setLocationRelativeTo(abcIU);
        agregarIU.setVisible(true);
        
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        if(agregar){
            principalControlador.agregar();
        }else{
            principalControlador.actualizarBD();
        }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        abcIU.dispose();
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        agregarIU.dispose();
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        principalControlador.editar();
        agregar = false;               
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        principalControlador.eliminar();
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        reportesIU.dispose();
    }//GEN-LAST:event_jButton12ActionPerformed

    private void reportesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reportesButtonActionPerformed
        reportesIU.setLocationRelativeTo(this);
        reportesIU.setVisible(true);
    }//GEN-LAST:event_reportesButtonActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        reportesControlador.mostrarReporteGeneral();
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        reportesControlador.mostrarReporteUsuariosIPMAC();
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        reportesControlador.mostrarReporteVLANS();
    }//GEN-LAST:event_jButton10ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        reportesControlador.guardarReporteGeneral();
    }//GEN-LAST:event_jButton13ActionPerformed

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        reportesControlador.guardarReporteUsuariosIPMAC();        
    }//GEN-LAST:event_jButton14ActionPerformed

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
        reportesControlador.guardarReporteVLANS();
    }//GEN-LAST:event_jButton15ActionPerformed

    private void ipTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ipTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ipTextFieldActionPerformed

    private void comuTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comuTextFieldActionPerformed
         // TODO add your handling code here:
    }//GEN-LAST:event_comuTextFieldActionPerformed

    private void puerto2TextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_puerto2TextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_puerto2TextFieldActionPerformed

    private void estadoSwitchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_estadoSwitchButtonActionPerformed
        estadoSwitchUI.setLocationRelativeTo(null);
        estadoSwitchUI.setVisible(true);        
    }//GEN-LAST:event_estadoSwitchButtonActionPerformed

    private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
        estadosSwitch.mostrarEstados();
    }//GEN-LAST:event_jButton17ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    @Override
    public Image getIconImage() {
        Image retValue = Toolkit.getDefaultToolkit().
                getImage(ClassLoader.getSystemResource("imagenes/db.png"));


        return retValue;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PrincipalVista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PrincipalVista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PrincipalVista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PrincipalVista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new PrincipalVista().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JDialog abcIU;
    public javax.swing.JDialog agregarIU;
    public javax.swing.JTextField comuTextField;
    public javax.swing.JTextField direccionIPTextField;
    public javax.swing.JTextField direccionMACTextField;
    private javax.swing.JButton estadoSwitchButton;
    private javax.swing.JDialog estadoSwitchUI;
    public javax.swing.JDialog generalReporte;
    public javax.swing.JTable generalTable;
    public javax.swing.JTextField ipTextField;
    public javax.swing.JButton jBPuerto1;
    public javax.swing.JButton jBPuerto10;
    public javax.swing.JButton jBPuerto11;
    public javax.swing.JButton jBPuerto12;
    public javax.swing.JButton jBPuerto13;
    public javax.swing.JButton jBPuerto14;
    public javax.swing.JButton jBPuerto15;
    public javax.swing.JButton jBPuerto16;
    public javax.swing.JButton jBPuerto17;
    public javax.swing.JButton jBPuerto18;
    public javax.swing.JButton jBPuerto19;
    public javax.swing.JButton jBPuerto2;
    public javax.swing.JButton jBPuerto20;
    public javax.swing.JButton jBPuerto21;
    public javax.swing.JButton jBPuerto22;
    public javax.swing.JButton jBPuerto23;
    public javax.swing.JButton jBPuerto24;
    public javax.swing.JButton jBPuerto3;
    public javax.swing.JButton jBPuerto4;
    public javax.swing.JButton jBPuerto5;
    public javax.swing.JButton jBPuerto6;
    public javax.swing.JButton jBPuerto7;
    public javax.swing.JButton jBPuerto8;
    public javax.swing.JButton jBPuerto9;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    public javax.swing.JButton jButton17;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    public javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    public javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    public javax.swing.JLabel jLabel14;
    public javax.swing.JLabel jLabel15;
    public javax.swing.JLabel jLabel16;
    public javax.swing.JLabel jLabel17;
    public javax.swing.JLabel jLabel18;
    public javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    public javax.swing.JLabel jLabel20;
    public javax.swing.JLabel jLabel21;
    public javax.swing.JLabel jLabel22;
    public javax.swing.JLabel jLabel23;
    public javax.swing.JLabel jLabel24;
    public javax.swing.JLabel jLabel25;
    public javax.swing.JLabel jLabel26;
    public javax.swing.JLabel jLabel27;
    public javax.swing.JLabel jLabel28;
    public javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    public javax.swing.JLabel jLabel30;
    public javax.swing.JLabel jLabel31;
    public javax.swing.JLabel jLabel32;
    public javax.swing.JLabel jLabel33;
    public javax.swing.JLabel jLabel34;
    public javax.swing.JLabel jLabel35;
    public javax.swing.JLabel jLabel36;
    public javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    public javax.swing.JLabel jLabel8;
    public javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    public javax.swing.JTextField modeloTextField;
    public javax.swing.JTextField nombreEquipoTextField;
    public javax.swing.JTable principalTable;
    public javax.swing.JTextField puerto2TextField;
    public javax.swing.JTextField puertoTextField;
    private javax.swing.JButton reporteButton;
    private javax.swing.JButton reportesButton;
    private javax.swing.JDialog reportesIU;
    public javax.swing.JTable usuIPMACTable;
    public javax.swing.JDialog usuMACIPIUReporte;
    public javax.swing.JTextField usuarioTextField;
    public javax.swing.JFormattedTextField vlanTextField;
    public javax.swing.JDialog vlansReporte;
    public javax.swing.JTable vlansTable;
    // End of variables declaration//GEN-END:variables
}
